﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;

namespace KeyboardImageViewer
{
    public class SummaryAndHashTask : IProcessTask
    {
        private HashTask hashTask;
        private SummaryTask summaryTask;

        public SummaryAndHashTask(long imageId, string filePath, DateTime refreshDate, bool newRow)
        {
            this.hashTask = new HashTask(imageId, filePath, refreshDate);
            this.summaryTask = new SummaryTask(imageId, filePath, refreshDate, newRow);
        }

        public void Process()
        {
            this.hashTask.Process();
            this.summaryTask.Process();
        }

        public void Commit(SQLiteConnection connection)
        {
            this.hashTask.Commit(connection);
            this.summaryTask.Commit(connection);
        }
    }
}
